<?php

/* 
 * Object/AppHistory.php
 */
namespace RHX\Model\Object;

class AppHistory{
    public $id;
    public $user;
    public $machine;
    public $libelle;
    public $date;
    public $heure;
    public $autre;
    
    public function __construct($data = array()){
        $this->exchangeArray($data);
    }
    
    public function exchangeArray($data = array()){
        $this->id = isset($data['id']) ? (int)$data['id'] : null;
        $this->user = isset($data['user']) ? (int)$data['user'] : 0;
        $this->machine = isset($data['machine']) ? $data['machine'] : '';
        $this->libelle = isset($data['libelle']) ? $data['libelle'] : '';
        $this->date = isset($data['date']) ? $data['date'] : date('Y-m-d');
        $this->heure = isset($data['heure']) ? $data['heure'] : date('H:i:s');
        $this->autre = isset($data['autre']) ? $data['autre'] : '';
    }
}
